import React, { useRef } from 'react'
import Child from './child'

const ForwardRefTest = () => {
    const inputRef = useRef<any>(null)

    const handleClick = () => {
        console.log(inputRef.current!.someValue)
        inputRef.current.setValue((val: any) => val + 1)
        // inputRef.current!.focus()
    }

    return (
        <div>
            <Child ref={inputRef} />
            <button onClick={handleClick}>focus</button>
        </div>
    )
}

export default ForwardRefTest
